Generic Serial Device Interface
The Generic Serial Device Interface allows unsupported serial devices to be incorporated into LS Central. To do so, you must implement a control for the hardware with a specific interface (ISerialDevice) in form of a DLL. You can then load the DLL into the POS client, allowing the hardware to be interfaced from the POS or LS Central code.
The interface (ISerialDevice) consists of an event-based read operation: write methods, serial configurations, and generic property methods.
Devices are set up and configured in LS Central on the Hardware Profile card, on the Generic Serial Devices FastTab.
For each device, you must configure the serial connection, for example the baud rate, parity, and stop bits to name a few. Each input event is routed to a codeunit specified on the Serial Device card, where the input event can be accessed from the single instance EPOS Control Event codeunit.
The control interface has a generic property setter that can be utilized to manipulate the device’s behavior and depend on the control implementation. This could be base64 encoding, timeouts, or other properties that are relevant to the device.
Generic Serial Control
A generic control (DLL) is supplied as a default option and offers some extra properties to fit various devices’ requirements:
| Type | Type | Name |
|---|---|---|
| EncodeAsBase64 | Boolean (True/False) | If set to true, all input events are encoded with base64. Can be useful if the serial device return binary data (non-ASCII). |
| TimeToTrigger | Double [ms] | Wait for TimeToTrigger ms to trigger read event after last read operation. |
| Prefix | Byte[]*/ String | Delimiter for beginning of a message from device. |
| Postfix | Byte[]*/ String | Delimiter for end of a message from device. |
* In order to input bytes in the value field for a property (on the Serial Device card), you must enter a sequence of HEX values in the form: 0x4c, 0x53, 0x20, 0x52, 0x65, 0x74, 0x61, 0x69, 0x6c.